/*
使用u8glib显示位图
图形显示器：OpenJumper MINI 12864
控制器：Arduino UNO
*/

#include "U8glib.h"
U8GLIB_MINI12864 u8g(10, 9, 8);
/*宽度x高度=96x64*/
#define width 96
#define height 64

static unsigned charbitmap[] U8G_PROGMEM = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x80,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0xF0,0x00,0x00,0xE0,0xFF,0xFF,0x1F,
0x00,0x78,0x00,0x00,0x00,0xF0,0x1F,0x00,0x7C,0x00,0x00,0xFC,0xC0,0x7F,0x00,0x00,
//为节约篇幅，此处代码省略
0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,
0xFF,0xFF,0xFF,0xFF,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFF,0xFF,0xFF,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};

void draw(void) {
  // graphic commands to redraw the complete screen should be placed here  
  u8g.drawXBMP( 0, 0, width, height, bitmap);
}

void setup(void) {
}

void loop(void) 
{
  u8g.firstPage();  
  do
{
draw();
  } while( u8g.nextPage() );
  // 延时一定时间，再重绘图片
  delay(500);
}